<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/1/9/009
 * Time: 10:40
 */

namespace app\api\controller\v1;

use app\api\model\Franchise as FranchiseModel;

use app\api\controller\BaseController;
use app\api\validate\FranchiseValidate;
use app\api\validate\IDMustBePostiveInt;

class Franchise extends BaseController {

    /**
     * 根据地址获取特许商城列表
     * @param $address
     * @return mixed
     */
    public function franchiseListByAddress($address) {
        (new FranchiseValidate())->goCheck();

        return FranchiseModel::franchiseList($address);
    }

    /**
     * 获取特许商城详情
     * @param $id
     * @return null|\think\Model
     */
    public function franchiseListInfo($id) {
        (new IDMustBePostiveInt())->goCheck();
        return FranchiseModel::franchiseListInfo($id);
    }
}